<?php
namespace Admin\Model;
use Think\Model\RelationModel;
/**
* Category
*/
class CategoryModel extends RelationModel
{
	public $_link = array(
		'Section' => array(
			'mapping_type' => self::BELONGS_TO,
			'class_name' => 'Section',
			'foreign_key' => 'sectionid',
			'mapping_name' => 'sections',
			'as_fields' => 'title:sec_title',
		),
		'Article' => array(
			'mapping_type'  => self::HAS_MANY,
			'class_name'    => 'Article',
			'foreign_key'   => 'catid',
			'mapping_name'  => 'articles',
		),
	);
}